package cn.gcjxsc.common.consts;

/**
 * @author pumbaa
 * @since 1.0
 */
public enum RedPackType {
    /**
     * 购物红包
     */
    BUY(101),
    /**
     * 购物退回
     */
    BUY_BACK(102),
    /**
     * 分享红包
     */
    SHARE(201),
    /**
     * 分享退回
     */
    SHARE_BACK(202);

    private int type;

    RedPackType(int type) {
        this.type = type;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public static RedPackType fromCode(int type) {
        RedPackType[] values = RedPackType.values();
        for (RedPackType value : values) {
            if (value.getType() == type) {
                return value;
            }
        }
        return null;
    }
}
